﻿/* ========== Variables ========== */
:root {
    --hot-color: #dc3545;
    --hot-light: #f8d7da;
    --hot-gradient: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    --cold-color: #0d6efd;
    --cold-light: #cfe2ff;
    --cold-gradient: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    --success-color: #28a745;
    --success-light: #d4edda;
    --warning-color: #ffc107;
    --warning-light: #fff3cd;
    --gray-color: #6c757d;
    --gray-light: #f8f9fa;
    --gray-dark: #343a40;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* ========== Page Container ========== */
.permits-page {
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========== Header ========== */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border-radius: var(--border-radius);
    color: white;
    box-shadow: var(--box-shadow);
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

    .page-title i {
        margin-left: 15px;
    }

.page-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin: 0;
}

/* ========== Statistics Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border-right: 5px solid;
}

    .stat-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

.stat-hot {
    border-color: var(--hot-color);
}

.stat-cold {
    border-color: var(--cold-color);
}

.stat-total {
    border-color: var(--warning-color);
}

.stat-active {
    border-color: var(--success-color);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-hot .stat-icon {
    background: var(--hot-light);
    color: var(--hot-color);
}

.stat-cold .stat-icon {
    background: var(--cold-light);
    color: var(--cold-color);
}

.stat-total .stat-icon {
    background: var(--warning-light);
    color: var(--warning-color);
}

.stat-active .stat-icon {
    background: var(--success-light);
    color: var(--success-color);
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-dark);
    line-height: 1;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 1rem;
    color: var(--gray-color);
    font-weight: 500;
}

/* ========== Actions Section ========== */
.actions-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.create-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-create {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    color: white;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

    .btn-create:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        color: white;
    }

    .btn-create i {
        font-size: 1.2rem;
    }

.btn-create-hot {
    background: var(--hot-gradient);
}

.btn-create-cold {
    background: var(--cold-gradient);
}

/* Filter Buttons */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-filter {
    padding: 10px 20px;
    border: 2px solid var(--gray-color);
    background: white;
    color: var(--gray-color);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .btn-filter:hover,
    .btn-filter.active {
        transform: translateY(-2px);
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    }

    .btn-filter.active {
        background: var(--gray-dark);
        color: white;
        border-color: var(--gray-dark);
    }

.btn-filter-hot.active {
    background: var(--hot-color);
    border-color: var(--hot-color);
}

.btn-filter-cold.active {
    background: var(--cold-color);
    border-color: var(--cold-color);
}

/* ========== Table Container ========== */
.table-container {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.permits-table {
    width: 100%;
    border-collapse: collapse;
}

    .permits-table thead {
        background: linear-gradient(135deg, #28a745 0%, #218838 100%);
        color: white;
    }

        .permits-table thead th {
            padding: 18px 15px;
            text-align: center;
            font-weight: 600;
            font-size: 1rem;
            white-space: nowrap;
        }

            .permits-table thead th i {
                margin-left: 8px;
            }

    .permits-table tbody tr {
        border-bottom: 1px solid #dee2e6;
        transition: var(--transition);
    }

        .permits-table tbody tr:hover {
            background: var(--gray-light);
        }

    .permits-table tbody td {
        padding: 15px;
        text-align: center;
        vertical-align: middle;
    }

/* Permit Number */
.permit-number {
    font-weight: 700;
    color: var(--gray-dark);
    font-size: 1.1rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-hot {
    background: var(--hot-light);
    color: var(--hot-color);
}

.badge-cold {
    background: var(--cold-light);
    color: var(--cold-color);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.85rem;
}

.status-active {
    background: var(--success-light);
    color: var(--success-color);
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Description Cell */
.description-cell {
    max-width: 250px;
    text-align: right;
    padding-right: 20px;
}

/* Date Display */
.date-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-color);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-action {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
    border: 2px solid;
}

.btn-view {
    background: white;
    color: #17a2b8;
    border-color: #17a2b8;
}

    .btn-view:hover {
        background: #17a2b8;
        color: white;
    }

.btn-edit {
    background: white;
    color: #ffc107;
    border-color: #ffc107;
}

    .btn-edit:hover {
        background: #ffc107;
        color: white;
    }

.btn-print {
    background: white;
    color: var(--gray-color);
    border-color: var(--gray-color);
}

    .btn-print:hover {
        background: var(--gray-color);
        color: white;
    }

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.empty-icon {
    font-size: 5rem;
    color: var(--gray-color);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-color);
    margin-bottom: 30px;
}

.btn-empty-action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: var(--success-color);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

    .btn-empty-action:hover {
        background: #218838;
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
        color: white;
    }

/* ========== Responsive Design ========== */

/* Tablets */
@media (max-width: 991.98px) {
    .page-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .actions-section {
        flex-direction: column;
        align-items: stretch;
    }

    .create-buttons,
    .filter-buttons {
        justify-content: center;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .permits-page {
        padding: 15px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Responsive Table */
    .table-container {
        overflow-x: auto;
    }

    .permits-table {
        display: block;
    }

        .permits-table thead {
            display: none;
        }

        .permits-table tbody {
            display: block;
        }

            .permits-table tbody tr {
                display: block;
                margin-bottom: 15px;
                border: 2px solid #dee2e6;
                border-radius: 8px;
                padding: 15px;
            }

            .permits-table tbody td {
                display: flex;
                justify-content: space-between;
                padding: 10px 0;
                border-bottom: 1px solid #f1f1f1;
                text-align: right;
            }

                .permits-table tbody td:last-child {
                    border-bottom: none;
                }

                .permits-table tbody td::before {
                    content: attr(data-label);
                    font-weight: 600;
                    color: var(--gray-dark);
                    margin-left: 10px;
                }

    .description-cell {
        max-width: 100%;
    }

    .action-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .btn-create {
        width: 100%;
        justify-content: center;
    }

    .btn-filter {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.3rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .stat-label {
        font-size: 0.9rem;
    }

    .btn-create {
        font-size: 0.9rem;
        padding: 10px 20px;
    }

    .btn-filter {
        font-size: 0.85rem;
        padding: 8px 15px;
    }
}
/* Search Section Styles */
.search-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.search-form {
    width: 100%;
}

.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.search-field {
    display: flex;
    flex-direction: column;
}

    .search-field label {
        font-weight: 600;
        color: #2d3748;
        margin-bottom: 8px;
        font-size: 0.95rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .search-field label i {
            color: #667eea;
            font-size: 0.9rem;
        }

.form-select,
.form-control {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f7fafc;
    font-family: 'Cairo', sans-serif;
}

    .form-select:focus,
    .form-control:focus {
        outline: none;
        border-color: #667eea;
        background-color: white;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 15px center;
    padding-left: 40px;
}

.search-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-search,
.btn-reset {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

    .btn-search:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }

.btn-reset {
    background: #e2e8f0;
    color: #4a5568;
}

    .btn-reset:hover {
        background: #cbd5e0;
        transform: translateY(-2px);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .search-grid {
        grid-template-columns: 1fr;
    }

    .search-actions {
        flex-direction: column;
    }

    .btn-search,
    .btn-reset {
        width: 100%;
        justify-content: center;
    }
}
/* ============================================ */
/* CSS إضافي لعمود نوع النشاط */
/* أضف هذا الكود في ملف: wwwroot/css/index premit.css */
/* ============================================ */

/* Badge نوع النشاط */
.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    padding: 0.35rem 0.85rem;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .badge-info:hover {
        background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
    }

/* Text مؤقت "غير محدد" */
.text-muted {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* تحسين عرض الجدول */
.permits-table td[data-label="نوع النشاط"] {
    text-align: center;
    vertical-align: middle;
}

/* للشاشات الصغيرة (موبايل) */
@media (max-width: 768px) {
    .permits-table td[data-label="نوع النشاط"] {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #dee2e6;
    }

        .permits-table td[data-label="نوع النشاط"]::before {
            content: "نوع النشاط:";
            font-weight: 600;
            color: #495057;
            margin-left: 0.5rem;
        }

    .badge-info {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }
}

/* تحسين عرض tooltip عند hover */
.badge-info[title] {
    cursor: help;
    position: relative;
}

    .badge-info[title]:hover::after {
        content: attr(title);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background-color: #333;
        color: white;
        padding: 0.5rem 0.75rem;
        border-radius: 0.25rem;
        white-space: nowrap;
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .badge-info[title]:hover::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #333;
        margin-bottom: -6px;
        z-index: 1000;
    }

/* تحسين تباعد الأعمدة */
.permits-table th:nth-child(4),
.permits-table td:nth-child(4) {
    min-width: 150px;
}
/* Badge الموقع */
.badge-location {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(108, 117, 125, 0.25);
    transition: all 0.3s ease;
}

    .badge-location:hover {
        background: linear-gradient(135deg, #495057 0%, #343a40 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(108, 117, 125, 0.35);
    }

    .badge-location i {
        margin-left: 6px;
        color: #ffc107;
    }
/* إصلاح عمود الوصف */
.description-cell {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

    /* عند hover - إظهار النص الكامل */
    .description-cell:hover {
        white-space: normal;
        word-wrap: break-word;
        overflow: visible;
        position: relative;
        z-index: 10;
        background: white;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
        padding: 8px;
        border-radius: 4px;
    }

/* تحديد عرض ثابت للجدول */
.permits-table {
    table-layout: fixed;
    width: 100%;
}

    .permits-table th:nth-child(4),
    .permits-table td:nth-child(4) {
        width: 250px; /* عرض عمود الوصف */
    }